cmake_minimum_required(VERSION 2.8)
project (application)

find_package(OpenMP)
if (OPENMP_FOUND)
    set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
    #set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
endif()
add_subdirectory(faiss)

SET (CMAKE_CXX_FLAGS "-DHAVE_CONFIG_H")
find_package( Caffe REQUIRED )
find_package( OpenCV REQUIRED )

INCLUDE_DIRECTORIES(  
${Caffe_INCLUDE_DIRS}
/home/iie/deep-thrift
./faiss
#/usr/local/include/thrift
)  
  

ADD_DEFINITIONS("-DHAVE_NETINET_IN_H")  
add_definitions(${Caffe_DEFINITIONS})

add_executable(application deepDemo.cpp)
target_link_libraries(application ${Caffe_LIBRARIES})
target_link_libraries(application ${OpenCV_LIBS} )
target_link_libraries(application faiss)


add_executable(appserver EngineService_server.skeleton-faiss.cpp  EngineService.cpp engine_constants.cpp  engine_types.cpp)
target_link_libraries(appserver ${Caffe_LIBRARIES})
target_link_libraries(appserver ${OpenCV_LIBS} )
TARGET_LINK_LIBRARIES(appserver thriftnb thrift event) 
TARGET_LINK_LIBRARIES(appserver faiss)
